Devices and methods for monitoring physiological information relating to sleep with an implantable device

ABSTRACT

Described here are implantable devices and methods for monitoring physiological information relating to sleep. The implantable devices are generally designed to include at least one sensor for sensing physiological information, a processor for processing the physiological information using low computational power to detect a sleep stage, and a battery. The detected sleep stage information may then be used to indicate sleep quality, identify or monitor a medical condition, or guide treatment thereof.

RELATED APPLICATION

This application is a continuation application of U.S. patentapplication Ser. No. 12/971,455, filed Dec. 17, 2010, which is adivisional application of U.S. patent application Ser. No. 11/704,451,filed Feb. 9, 2007, now U.S. Pat. No. 7,894,890, issued Feb. 22, 2011,which are incorporated by reference herein in their entirety.

FIELD

The implantable devices and methods described here relate to the fieldof sleep staging and sleep monitoring. More specifically, theimplantable devices and methods relate to sleep staging and sleepmonitoring that is accomplished by detecting and analyzing physiologicalsignals.

BACKGROUND

Sleep is a state of brain activity defined as unconsciousness from whicha person can be aroused by sensory or other stimuli (Arthur C. Guyton,Textbook of Medical Physiology 659 (8^(th) ed. 1991)). While asleep, aperson typically goes through two alternating states of sleep, rapid eyemovement (REM) sleep and non-REM sleep. Non-REM sleep is comprised offour sleep stages. Stage 1 (S1) is a state of drowsiness or transitionbetween wake and sleep. Stage 2 (S2) is a state of light sleep. Stage 3(S3) and stage 4 (S4) are stages of deep sleep. REM sleep occurs about80 to 100 minutes after falling asleep, and is characterized by highfrequency EEG activity, bursts of rapid eye movement, and heightenedautonomic activity. Sleep progresses in a cycle from stage 1 throughstage 4 to REM sleep. A person typically experiences four to six REMperiods per sleep period.

Sleep disorders such as sleep apnea, restless legs syndrome, andnarcolepsy, inevitably result in sleep deprivation, which among otherthings, interferes with work, driving, and social activities. Variousneurological and psychiatric conditions are also associated withdisruptions of normal sleep patterns. For example, insomnia oroversleeping may occur in individuals with depression, and thoseexperiencing a manic upswing characteristic of bipolar disorder may notsleep at all. Furthermore, because REM sleep increases sympatheticnervous system activity, myocardial ischemia or arrhythmia may betriggered during REM sleep in individuals with preexisting heartpathology. Thus, the detection and characterization of sleep states isimportant in the evaluation and treatment of many medical conditions.

Currently, information about sleep stages is obtained usingpolysomnography, a procedure in which data is acquired related tovarious body activities, including EEG waveforms, cardiac muscleactivity, and breathing. This type of evaluation usually is conducted ina sleep laboratory over one or more nights, and thus is not convenientwhen it is desirable to monitor a patient over an extended period oftime. There are ambulatory sleep monitoring systems, however continuousand extended sleep monitoring can nonetheless be inconvenient becausethese systems must be applied to the patient and adjusted prior to everysleep episode. Furthermore, many known devices and systems for assessingEEG waveforms (e.g., using time-domain and frequency-domain analysis)require more computational ability than can be easily included in animplantable device.

Accordingly, it would be desirable to have an implantable device capableof continuously monitoring sleep. It would also be desirable to haveimplantable devices that are capable of detecting different stages ofsleep. Similarly, it would be desirable to have implantable devices withmonitoring and detecting functions for evaluating and treating variousmedical conditions associated with disturbed sleep patterns.

SUMMARY

Described here are implantable devices and methods for monitoring sleepand detecting various sleep stages. To detect at least one sleep stage,the implantable devices generally include at least one sensor designedto sense physiological information, a processor configured to processthe physiological information using low computational power, and abattery that may or may not be rechargeable. The implantable devices arealso capable of processing the physiological information to indicate thequality of sleep, and characterize the information in a manner thathelps to diagnose various medical conditions and/or to guide therapy. Insome variations, the implantable device is configured to deliver one ormore therapies. For example, the implantable device may contain a drugpump or drug-eluting electrode, or may be configured to deliverelectrical stimulation.

The implantable device may also include memory that is configured tostore at least a portion of the physiological information or theprocessed physiological information. Additionally, the implantabledevice may employ a wireless system for transmitting at least a portionof the physiological information or processed physiological informationto a remote location.

The type of sensor(s) that are included in the implantable device willdepend upon the type of physiological information that it is desired tosense and process. For example, cardiac sensors may be used to obtaincardiac information; neurological sensors may be used to obtainneurological information, positional sensors may used to obtainpositional information, and respiratory sensors may be used to obtainrespiratory information. More specifically, the types of physiologicalinformation that may be sensed include, but are not limited to, heartrate, blood-oxygen saturation, partial pressure of oxygen within theblood, core temperature, head movement, cerebral metabolic rate, andcerebral blood flow. In some instances, the physiological informationobtained is electrographic in form. For example, the physiologicalinformation may be recorded as an electroencephalogram (EEG),electrocorticogram (ECoG), electrocardiogram (EKG), electromyogram(EMG), or electro-oculogram (EOG).

In one variation, the implantable device may contain at least onesensor, and in other variations, it may include two or more sensors.When two or more sensors are present, they may sense the same ordifferent types of physiological information. The sensor may be either adepth electrode or strip electrode, depending on the nature of thephysiological information to be sensed. Examples of strip electrodesinclude, but are not limited to, electrodes that are placed within orbeneath the scalp or on the skull, or electrodes that are epidurally orsubdurally placed. Similarly, the depth or strip electrodes may employmonopolar or bipolar sensing. In some variations, the implantable devicefurther includes a stimulation electrode or at least one sensor that isconfigured to provide stimulation as well as sensing. In othervariations, the implantable device further includes a component that iscapable of patient-triggered event recording. This component may be asensor that is designed to sense magnetic field changes.

Methods for detecting sleep stages are also described. In one variation,the method includes sensing physiological information and processingthat information using low computational power to detect at least onesleep stage. The REM state, the stages S1, S2, S3, S4, or anycombination of the REM state and the sleep stages may be detected. Thealgorithm may employ half-waves, a histogram counter, a thresholddetector, Fourier transforms, or a combination thereof to process thephysiological information using low computational power.

The information obtained related to sleep states and stages may be usedto diagnose or treat a medical condition, or to guide therapy for amedical condition. Examples of medical conditions include neurologicalconditions, psychological conditions, cardiac conditions, respiratoryconditions, and sleep conditions. In one variation, stimulation is usedto treat a medical condition. The stimulation may be selected andregulated based on the sleep state or stage that is detected.Specifically, the stimulation may be regulated by changing thefrequency, pulse-width, amplitude, or duration of the stimulation, or bychanging the stimulation montage. The stimulation may also be initiatedor terminated based on the detection of a particular sleep state orstage.

In another variation, the medical condition is treated by delivery of adrug. The type of drug delivered, dosage, and/or rate of delivery may bebased on the particular sleep state or stage detected. Similarly, whendrug delivery is initiated or terminated or how drug delivery isregulated may be determined based upon the sleep state or stage a personis experiencing.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a side view of a portion of a person's head where locationsare identified at which an implantable device for monitoringphysiological information relating to sleep may be implanted.

FIG. 2 is a perspective view of an implantable device for monitoringphysiological information relating to sleep within the cranium.

FIG. 3 is a schematic diagram of a method for monitoring physiologicalinformation relating to sleep.

FIG. 4 is a block diagram of an implantable device for monitoringphysiological information relating to sleep.

FIG. 5 is a block diagram of a detection subsystem of the implantabledevice shown in FIG. 4.

FIG. 6 is a block diagram of a sensing front end of the detectionsubsystem of FIG. 5.

FIG. 7 is a block diagram of a waveform analyzer of the detectionsubsystem of FIG. 5.

FIG. 8 is a block diagram of certain components of the waveform analyzerof the detection subsystem of FIG. 5.

FIG. 9A is a graphical representation of an EEG signal illustrating thesignal decomposed into time windows and samples.

FIGS. 9B-9D are graphical representations of EEG signals that may bedetected during stages of sleep. FIG. 9B is a graph of a slow deltawave. FIG. 9C is a graph of a theta wave. FIG. 9D is a graph of an alphawave.

FIG. 10A is another graph of the EEG signal of FIG. 9A, illustratinghalf waves extracted from the signal.

FIG. 10B is a graph of an ECoG signal, illustrating minimum and maximumsignal amplitudes and durations.

FIG. 11 is a flow chart of a method of extracting half waves from an EEGsignal.

FIG. 12 is a flow chart of a method of analyzing half waves from an EEGsignal

FIG. 13 is a flow chart of a method of applying an X of Y criterion tohalf-wave windows using a central processing unit.

FIG. 14 is a graph of the EEG signal of FIG. 9A, illustrating aline-length function calculation.

FIG. 15 is a flow chart of a method of calculating the line-lengthfunction of FIG. 14 using the waveform analyzer of FIG. 7.

FIG. 16 is a flow chart of a method of calculating and analyzing aline-length function of an EEG signal

FIG. 17 is a graph of the EEG signal of FIG. 9A, illustrating an areafunction calculation.

FIG. 18 is a flow chart of a method FIG. 7 of calculating an areafunction as illustrated in FIG. 17 using the waveform analyzer or FIG.7.

FIG. 19 is a flow chart of a method of calculating and analyzing an areafunction of an EEG signal

FIG. 20 is a flow chart of a method of analyzing half wave, line length,and area information using an event-driven feature of the centralprocessing unit.

FIG. 21 is a flow chart of a method in which analytic tools are combinedwith a detection channel in an implantable device for monitoringphysiological information relating to sleep.

FIG. 22 is a flow chart of a method in which detection channels arecombined in an event detector.

FIG. 23 is a histogram of delta half-wave counts, where x-axis variableis time and the y-axis variable is the delta half-wave counts.

DETAILED DESCRIPTION

Described here are implantable devices and methods for monitoringphysiological information relating to sleep for detecting sleep statesor stages. The devices may be implanted in or on or adjacent to suitabletissue of any body region. The physiological information may be used tomonitor the sleep of a patient, and/or used to diagnose or guide therapyof a medical condition.

The devices are configured to use low computational power to performdevice functions. For example, the devices may use customized digitalelectronics modules that require low power and are minimally reliantupon a central processing unit to implement algorithms to reduce orextract features from data. One advantage of using algorithms thatrequire low computational power is that the actual power consumed by thedevices is less than what it would be if a greater degree ofcomputational power was required for the device to carry out itsintended functions. Preserving power in an implantable device isespecially desirable when the power source for the device, such as abattery, is implanted as well. That is, it is generally desirable forthe power supply to be sufficient to carry out the device functions foras long a period of time as possible, to avoid removing or explantingthe device to replace it or recharge it. Removing an implantable devicecan also cause damage to the device leads or other functional orstructural features of the device and, of course, explanting or removingany implantable device poses the risk of complications from the surgerywhich it would be desirable to avoid whenever possible.

Devices for Detecting Sleep Stages

The implantable devices for monitoring physiological informationrelating to sleep are configured to identify any sleep state, i.e., REMor non-REM, and any of the four standard sleep stages S1, S2, S3, andS4, or any combination of sleep states and stages. In one variation, theimplantable device includes at least one sensor that sensesphysiological information, a processor that processes the physiologicalinformation using low computational power to detect at least one sleepstate or stage, and a battery. The sensor(s) may be included in adetection subsystem that may also contain a waveform analyzer. Thewaveform analyzer may be capable of analyzing waveform features (such ashalf wave characteristics) as well as window-based analyses (such asline length and area under the curve) to provide sleep stage detection.A central processing unit is typically included to consolidate the datareceived from one or more sensors and coordinate action in reaction orresponse to the data received when necessary.

One variation of an implantable device is illustrated in FIG. 2. In FIG.2, the implantable device 110 is shown within one of the parietal bones210 of the skull of a patient, in a location anterior to the lambdoidalsuture 212. It should be noted, however, that the placement describedand illustrated herein is merely exemplary, and other locations andconfigurations are also possible, in the cranium or elsewhere, dependingon the size and shape of the device and individual patient needs, amongother factors. The device 110 may be configured to fit the contours ofthe patient's cranium 214. In another variation (shown in FIG. 1), thedevice may be implanted within or under the scalp 100, within or underthe skull 102, under the dura mater 104, or within the brain 106. In yetanother variation, the device may be implanted within the chest wall,e.g., within the pectoral region (not shown), with leads extendingthrough the patient's neck and between the patient's cranium and scalp,as necessary.

Referring to FIG. 2, the implantable device 110 may be placed within thepatient's cranium 214 by way of a ferrule 216. The ferrule 216 is astructural member adapted to fit into a cranial opening, attach to thecranium 214, and retain the device 110. To implant the device 110, acraniotomy is performed in the parietal bone anterior to the lambdoidalsuture 212 to define an opening 218 slightly larger than the device 110.The ferrule 216 is inserted into the opening 218 and affixed to thecranium 214, as with bone screws ensuring a tight and secure fit. Thedevice 110 is then inserted into and affixed to the ferrule 216.

As shown in FIG. 2, the device 110 includes a lead connector 220 adaptedto receive one or more electrical leads, such as a first lead 222. Thelead connector 220 acts to physically secure the lead 222 to the device110, and facilitates the electrical connection between a conductor inthe lead 222 and circuitry within the device 110. The lead connector 220accomplishes this in a substantially fluid-tight environment withbiocompatible materials.

The lead 222 is a flexible elongated member having one or moreconductors. The lead 222 is coupled to the device 110 via the leadconnector 220, and is generally situated on the outer surface of thecranium 214 (and under the patient's scalp 100), extending between thedevice 110 and a burr hole 224 or other cranial opening, where the lead222 enters the cranium 214 and is coupled to an electrode implanted in adesired location in the patient's brain. As described in U.S. Pat. No.6,006,124 to Fischell, et al., which is hereby incorporated by referencein its entirety, the burr hole 224 may be wholly or partially sealed,e.g., with a burr hole cover, after implantation to prevent furthermovement of the lead 222.

The device 110 may include a durable outer housing 226 fabricated from abiocompatible material. Titanium, which is light, extremely strong, andbiocompatible, is used in analogous devices, such as cardiac pacemakers,and would serve advantageously in this context. As the device 110 isself-contained, the housing 226 encloses a battery and any electroniccircuitry necessary or desirable to provide the functionality describedherein, as well as any other desirable features. As will be described infurther detail below, a telemetry coil may be provided outside of thehousing 226 (and potentially integrated with the lead connector 220) tofacilitate communication between the device 110 and external devices.The battery included in the implantable devices may be rechargeable. Ingeneral, the implantable devices may generally have a long-term averagecurrent consumption on the order of 10 microamps, which allows them tooperate on power provided by a coin cell or similarly small battery fora period of years without need for battery replacement. It should benoted, however, that as battery and power supply configurations vary,the long-term average current consumption of a device may also vary andstill provide satisfactory performance.

The configuration of the implantable device 110 provides severaladvantages over known alternative designs. First, the self-containednature of the device substantially decreases the need for access to thedevice 110, allowing the patient to participate in normal lifeactivities. Its small size and intracranial placement also may causeminimal cosmetic disfigurement. The device 110 will typically fit in anopening in the patient's cranium, under the patient's scalp, with littlenoticeable protrusion or bulge. Furthermore, the ferrule 216 used forimplantation allows a craniotomy to be performed and fit verified beforethe device 110 is implanted, thus avoiding the risk of breaking thedevice during this fitting process. The ferrule 216 also protects thebrain from the device in the event the brain is subjected to significantexternal pressure or impact by providing a structural support for thedevice in the skull. A further advantage is that the ferrule 216receives any cranial bone growth, so when the device is explanted orremoved, any cranial bone that has grown since the time of implant willimpinge upon the ferrule, not the device, so that the device can betaken out and/or replaced with another device without the need to removeany bone screws that are used to secure the ferrule 216. Only thefasteners that are used to retain the device 110 in the ferrule 216 needbe manipulated.

As stated above, and as illustrated in FIG. 3, the implantable devicemay operate in conjunction with external equipment. The device 110 ismostly autonomous (particularly when performing its usual sensing,detection, and stimulation capabilities), but may include a wirelesslink 310 that can be selectively engaged to external equipment such as aprogrammer 312 (e.g., a handheld programmer). The wireless link 310 maybe established by moving a wand or other suitable apparatus into rangeof the device 110 where the wand or other apparatus has wirelesscommunication capabilities and is coupled to the programmer 312. Theprogrammer 312 can then be used to manually control the operation of thedevice 110, as well as to transmit information to, or receiveinformation from, the device 110. Several specific capabilities andoperations the programmer 312 can perform in conjunction with the device110 are described in further detail below.

The programmer 312 is capable of performing a number of operations. Inparticular, the programmer 312 may be able to specify and set variableparameters in the device 110 to adapt the function of the device 110 tomeet the patient's needs, download or receive data (including but notlimited to stored electrographic waveforms, detections, parameters, orlogs of actions taken) from the device 110 to the programmer 312, uploador transmit program code and other information from the programmer 312to the device 110, or command the device 110 to perform specific actionsor change modes as desired by a physician operating the programmer 312.To facilitate these functions, the programmer 312 is adapted to receivephysician input 314 and provide physician output 316. The data may betransmitted between the programmer 312 and the device 110 over thewireless link 310.

The programmer 312 may be coupled via a communication link 318 to anetwork 320 such as the Internet. This allows any information downloadedfrom the device 110, as well as any program code or other information tobe uploaded to the device 110, to be stored in a database at one or moredata repository locations (which may include various servers andnetwork-connected programmers like the programmer 312). Patients and/orphysicians can thereby have access to important data, including pastmonitoring results and/or information concerning treatment of medicalconditions and the results of treatment, and software updates,essentially anywhere in the world where there is a programmer (like theprogrammer 312) and a network connection.

A block diagram of an implantable device 110 for monitoringphysiological information relating to sleep is illustrated in FIG. 4.Inside the housing 226 (shown in FIG. 2) of the device 110 there areseveral subsystems making up a control module 410. The control module410 is capable of being coupled to a plurality of electrodes 412, 414,416, and 418 (each of which may be connected to the control module 410via a lead that is analogous or identical to the lead 222 of FIG. 2) forsensing physiological information and providing stimulation, whendesired. The coupling may be accomplished through the lead connector 220(FIG. 2). Although four electrodes are shown in FIG. 4, it should berecognized that any number of electrodes is possible. For example, it ispossible to employ a single lead with at least two electrodes, or twoleads each with a single electrode (or with a second electrode providedby a conductive exterior portion of the housing 226).

The electrodes 412, 414, 416, and 418 are connected to an electrodeinterface 420. The electrode interface is capable of selecting eachelectrode as required for sensing and/or stimulation. Accordingly, theelectrode interface 420 is coupled to a detection subsystem 422 and/or astimulation subsystem 424. When the electrodes 412, 414, 416, and 418are designed primarily for sensing physiological information, astimulation subsystem 424 will typically not be included in the controlmodule 410. The electrode interface 420 also may provide any otherfeatures, capabilities, or aspects, including but not limited to,amplification, isolation, and charge-balancing functions, that arerequired for a proper interface with, e.g., neurological tissue, and notprovided by any other subsystem of the device 110.

The detection subsystem 422 may include an EEG (and/or ECoG) analyzerfunction. The EEG analyzer function may be adapted to receive EEGsignals from the electrodes 412, 414, 416, and 418 through the electrodeinterface 420, and process those EEG signals to identify neurologicalactivity indicative of various sleep states or stages. One way toimplement such EEG analysis functionality is disclosed in detail in U.S.Pat. No. 6,016,449 to Fischell et al., incorporated by reference above.In another variation, the detection subsystem may include a set ofsensors built specifically for sensing low-frequency EEG and/or ECoGsignals associated with sleep. These sensors may be configured as a setof half-wave detectors with allowable minimum and maximum amplituderanges and window durations to sense signals within the delta (0.5-3.5Hz), theta (4-7.5 Hz), and alpha (8-12 Hz) bands. Depending on theparticular indication of use, however, the sleep sensors may be adjustedto sense other frequency bands. The detections may be made using bipolaror monopolar recording. While monopolar recording is desirable sincesleep patterns are often synchronous over large cortical regions,adjusting the recording montage appropriately may be necessary tooptimize bipolar recordings for sleep monitoring. The detectionsubsystem may optionally also contain further sensing and detectioncapabilities, including but not limited to parameters derived from otherphysiological information (such as electrophysiological parameters,temperature, blood pressure, heart rate, position (including headposition), movement, etc.).

The detection subsystem may use the preexisting electrodes that wereplaced for neurostimulation for sleep state or stage detection, oradditional electrodes may be placed for optimum detection. For example,if noncortical leads were implanted for neurostimulation, an additionallead may be placed over the occipital cortex, or other desired cortexlocation, for sleep monitoring. Cardiac sensors (cardiac electrodes) mayalso be used to sense electrical activity (e.g., heart rate andconduction) of the heart. Respiratory sensors may be included that areconfigured to sense various respiratory parameters, such as respiratoryrate, tidal volume, and minute ventilation.

The sensors may be coupled to a low-speed, low-power central processingunit that detects and processes the sensor data. For example, thecentral processing unit may be configured to have a processing speed ofbetween about 100 Hz to about 1000 Hz. In some cases, a processing speedof less than 100 Hz may be utilized. A processor may be included toreceive EEG and/or ECoG data from the sensors. The processor may performsleep state or stage detection on a real-time basis, or may processpreviously acquired and stored sensor data in a batch mode toretrospectively classify sleep stages of one or more sleep periods. Thecentral processing unit may remain in a suspended “quiet” statecharacterized by relative inactivity for a substantial percentage of thetime, and then may be periodically awakened by interruptions from thedetection subsystem to perform certain tasks related to the detectionand prediction schemes enabled by the device.

If included, the stimulation subsystem 424 is capable of applyingelectrical stimulation to tissue through the electrodes 412, 414, 416,and 418. This can be accomplished in any of a number of different ways.For example, it may be advantageous in some circumstances to providestimulation in the form of a substantially continuous stream of pulsesor, alternatively, on a scheduled basis. In some instances, therapeuticstimulation may be provided in response to specific sleep stagesdetected by the EEG analyzer function of the detection subsystem 422. Asillustrated in FIG. 4, the stimulation subsystem 424 and the EEGanalyzer function of the detection subsystem are in communication witheach other. This facilitates the ability of stimulation subsystem 424 toprovide responsive stimulation as well as an ability of the detectionsubsystem 422 to blank the amplifiers while stimulation is beingperformed to minimize stimulation artifacts. It is contemplated that theparameters of the stimulation signal (e.g., frequency, duration,waveform) provided by the stimulation subsystem 424 would be specifiedby other subsystems in the control module 410, as will be described infurther detail below.

A memory subsystem 426 and a central processing unit (CPU) 428, whichcan take the form of a microcontroller, may also be included in thecontrol module 410. The memory subsystem is coupled to the detectionsubsystem 422 (e.g., for receiving and storing data representative ofsensed EEG signals and evoked responses), the stimulation subsystem 424(e.g., for providing stimulation waveform parameters to the stimulationsubsystem), and the CPU 428, which can control the operation of thememory subsystem 426. In addition to the memory subsystem 426, the CPU428 may also be connected to the detection subsystem 422 and thestimulation subsystem 424 for direct control of those subsystems.

Also provided in the control module 410, and coupled to the memorysubsystem 426 and the CPU 428, is a communication subsystem 430. Thecommunication subsystem 430 enables communication between the device 110and the outside world, particularly the external programmer 312 (FIG.3). As set forth above, the communication subsystem 430 may include atelemetry coil (which may be situated outside of the housing 226), whichenables transmission and reception of signals, to or from an externalapparatus via inductive coupling. Alternatively, the communicationsubsystem 430 may use an antenna for an RF link or an audio transducerfor an audio link.

Further subsystems in the control module 410 are a power supply 432 anda clock supply 434. The power supply 432 supplies the voltages andcurrents necessary for each of the other subsystems. The clock supply434 supplies substantially all of the other subsystems with any clockand timing signals necessary for their operation.

It should be observed that while the memory subsystem 426 is illustratedin FIG. 4 as a separate functional subsystem, the other subsystems mayalso require various amounts of memory to perform the functionsdescribed above and others. Furthermore, while the control module 410 isshown as a single physical unit contained within a single physicalenclosure, namely the housing 226 (FIG. 2), it may comprise a pluralityof spatially separate units, with each performing a subset of thecapabilities described above. Also, it should be noted that the variousfunctions and capabilities of the subsystems described above may beperformed by electronic hardware, computer software (or firmware), or acombination thereof. The division of work between the CPU 428 and theother functional subsystems may also vary.

The detection subsystem is further detailed in FIG. 5. In FIG. 5, inputsfrom the electrodes 412, 414, 416, and 418 (FIG. 4) are depicted on theleft, and connections to other subsystems are shown on the right.Signals received from the electrodes 412, 414, 416, and 418 (as routedthrough the electrode interface 420) are received in an electrodeselector 510. The electrode selector 510 allows the device to selectwhich electrodes (of the electrodes 412, 414, 416, 418) should be routedto which individual sensing channels of the detection subsystem 422,based on commands received through a control interface 518 from thememory subsystem 426 or the CPU 428 (FIG. 4). In one variation, eachsensing channel of the detection subsystem 422 receives a monopolar orbipolar signal representative of the difference in electrical potentialbetween two selectable electrodes. Accordingly, the electrode selector510 provides signals corresponding to each pair of selected electrodes(of the electrodes 412, 414, 416, 418) to a sensing front end 512, whichperforms amplification, analog-to-digital conversion, and multiplexingfunctions on the signals in the sensing channels. The sensing front endwill be described further below in connection with FIG. 6. In anothervariation, each sensing channel of the detection subsystem 422 mayreceive a monopolar or bipolar signal representative of the differencein electrical potential between an electrode and the housing of theimplantable device (which may also serve as an electrode).

A multiplexed input signal representative of all active sensing channelsis then fed from the sensing front end 512 to a waveform analyzer 514.The waveform analyzer 514 may include a special-purpose digital signalprocessor (DSP) or, in another variation, may comprise a programmablegeneral-purpose DSP. Referring to FIG. 5, the waveform analyzer may haveits own scratchpad memory area 516 for local storage of data and programvariables when signal processing is being performed. In either case, thesignal processor performs suitable measurement and detection methodsdescribed generally above and in greater detail below. Any results fromsuch methods, as well as any digitized signals intended for storagetransmission to external equipment, are passed to various othersubsystems of the control module 410, including the memory subsystem 426and the CPU 428 (FIG. 4), through a data interface 520. Similarly, thecontrol interface 518 allows the waveform analyzer 514 and the electrodeselector 510 to be in communication with the CPU 428.

Referring now to FIG. 6, the sensing front end 512 is illustrated infurther detail. As shown, the sensing front end includes a plurality ofdifferential amplifier channels 610, each of which receives a selectedpair of inputs from the electrode selector 510 or from the electrodeselector 510 and implantable device housing. In one variation, each ofthe differential amplifier channels 610 is adapted to receive or toshare inputs with one or more other differential amplifier channels 610without adversely affecting the sensing and detection capabilities ofthe implantable device. In another variation, there are at least eightelectrodes, which can be mapped separately to eight differentialamplifier channels 610 representing eight different sensing channels andcapable of individually processing eight bipolar signals, each of whichrepresents an electrical potential difference between two monopolarinput signals received from the electrodes and applied to the sensingchannels via the electrode selector 510. For clarity, only five channelsare illustrated in FIG. 6, but it should be noted that any practicalnumber of sensing channels may be employed.

Each differential amplifier channel 610 feeds a correspondinganalog-to-digital converter (ADC) 612. The analog-to-digital converters612 may be separately programmable with respect to sample rates. In onevariation, the ADCs 612 convert analog signals into 10-bit unsignedinteger digital data streams at a sample rate selectable between 250 Hzand 500 Hz. In other variations where waveforms are used, as describedbelow, sample rates of 250 Hz are typically used. However, numeroussample rate and resolution options are possible, with tradeoffs known toindividuals of ordinary skill in the art of electronic signalprocessing. The resulting digital signals are received by a multiplexer614 that creates a single interleaved digital data stream representativeof the data from all active sensing channels. As will be described infurther detail below, not all of the sensing channels need to be used atone time, and it may in fact be advantageous in certain circumstances todeactivate certain sensing channels to reduce power consumption.

It should be noted that as illustrated and described herein, a “sensingchannel” is not necessarily a single physical or functional item thatcan be identified in any illustration. Rather, a sensing channel isformed from the functional sequence of operations described herein, andparticularly represents a single electrical signal received from anypair or combination of electrodes (including the implantable devicehousing, which can serve as an electrode), as preprocessed by a methodfor monitoring physiological information relating to sleep with animplantable device, in both analog and digital forms. See, e.g., U.S.Pat. No. 6,473,639 to D. Fischell et al., filed on Mar. 2, 2000, andentitled “Neurological Event Detection Using Processed Display ChannelBased Algorithms and Devices Incorporating These Procedures,” which ishereby incorporated by reference in its entirety. At times (particularlyafter the multiplexer 614), multiple sensing channels are processed bythe same physical and functional components of the system;notwithstanding that, it should be recognized that unless thedescription herein indicates to the contrary, the implantable devicesdescribed herein process, handle, and treat each sensing channelindependently. Referring again to FIG. 6, the interleaved digital datastream is passed from the multiplexer 614, out of the sensing front end512, and into the waveform analyzer 514. The waveform analyzer 514 isillustrated in greater detail in FIG. 7.

In FIG. 7, the interleaved digital data stream representing informationfrom all of the active sensing channels is first received by a channelcontroller 710. The channel controller applies information from theactive sensing channels to a number of wave morphology analysis units712 and window analysis units 714. It is preferred to have as many wavemorphology analysis units 712 and window analysis units 714 as possible,consistent with the goals of efficiency, size, and low power consumptionnecessary for an implantable device. In one variation, there are sixteenwave morphology analysis units 712 and eight window analysis units 714,each of which can receive data from any of the sensing channels of thesensing front end 512, and each of which can be operated with differentand independent parameters, including differing sample rates, as will bediscussed in further detail below.

Each of the wave morphology analysis units 712 operates to extractcertain feature information from an input waveform as described below inconjunction with FIGS. 9A-11. Similarly, each of the window analysisunits 714 performs certain data reduction and signal analysis withintime windows in the manner described in conjunction with FIG. 12-17.Output data from the various wave morphology analysis units 712 andwindow analysis units 714 may be combined via event detector logic 716.The event detector logic 716 and the channel controller 710 may becontrolled by control commands 718 received from the control interface518 (FIG. 5).

The term “detection channel,” as used herein, refers to a data streamincluding the active sensing front end 512 and the analysis units of thewaveform analyzer 514 processing that data stream, in both analog anddigital forms. It should be noted that each detection channel canreceive data from a single sensing channel and each sensing channel canbe applied to the input of any combination of detection channels. Thelatter selection is accomplished by the channel controller 710. As withthe sensing channels, not all detection channels need to be active;certain detection channels can be deactivated to save power or ifadditional detection processing is deemed unnecessary in certainapplications.

In conjunction with the operation of the wave morphology analysis units712 and the window analysis units 714, a memory area (e.g., scratchpadmemory) 516 may be provided for temporary storage of processed data. Thememory area 516 may be physically part of the memory subsystem 426, oralternatively may be provided for the exclusive use of the waveformanalyzer 514. Other subsystems and components of the implantable devicemay also be furnished with local memory if such configurations arebeneficial.

The operation of the event detector logic 716 (i.e., sleep stagedetector logic) is illustrated in detail in the functional block diagramof FIG. 8, which shows four exemplary sensing channels 810, 814, 818,and 820 and three illustrative event detectors 812, 816, and 822 foranalyzing the data from the sensing channels. A first sensing channel810 (“Channel 1” in FIG. 8) provides input to a first event detector812. (It should be recognized the blocks shown in FIG. 8 denotefunction, and a particular block may or may not correspond to a physicalstructure in the implantable device.) A second sensing channel 814(“Channel 2” in FIG. 8) provides input to a second event detector 816,and a third sensing channel 818 (“Channel 3” in FIG. 8) and a fourthsensing channel 820 (“Channel 4” in FIG. 8) both provide input to athird event detector 822.

The processing that is performed in association with each of the threeevent detectors 812, 816, and 822 will now be described, again withreference to FIG. 8. The first sensing channel 810 (“Channel 1”) feeds asignal to the first event detector 812, which is applied to both a wavemorphology analysis unit 824 (e.g., one of the wave morphology analysisunits 712 of FIG. 7) and a window analysis unit 826 (e.g., one of thewindow analysis units 714 of FIG. 7). The window analysis unit 826, inturn, includes a line length analysis tool 828 and an area analysis tool830. As will be discussed in detail below, the line length analysis tool828 and the area analysis tool 830 analyze different aspects of thesignal from the first input channel 810.

The outputs from the wave morphology analysis unit 824, the line lengthanalysis tool 828, and the area analysis tool 830 of the first eventdetector 812 are combined in a Boolean “AND” operation 832 into a singleoutput for the first event detector 834. The output 834 then may be usedby another system or subsystem for further monitoring or analysis. Forexample, if a combination of analysis tools in an event detectoridentifies several simultaneous (or near-simultaneous) types of activityin an input channel, another system or subsystem in the implantabledevice or operating in conjunction with the implantable device may beprogrammed to perform an action in response to the output 834. Detailsof the analysis tools and the combination processes used in the eventdetectors herein described will be set forth in greater detail below.

In the second event detector 816, which receives input from secondsensing channel 814 (“Channel 2”), only a wave morphology analysis unit836 is active. Accordingly, no Boolean operation needs to be performed,and the wave morphology analysis unit 836 is used directly as an eventdetector output 838.

The third event detector 822 receives signals from both the third inputsensing channel 818 (“Channel 3”) and the fourth input sensing channel820 (“Channel 4”), and includes two separate detection channels ofanalysis units: a first wave morphology analysis unit 840 and a firstwindow analysis unit 842, the first window analysis unit 842 including afirst line length analysis tool 844 and a first area analysis tool 846;and a second wave morphology analysis unit 848 and a second windowanalysis unit 850, the second window analysis unit 850 including asecond line length analysis tool 852 and a second area analysis tool854. The two detection channels of analysis units in the third eventdetector 822 are thus processed and operated on so as to provide asingle third event detector output 856.

More specifically, the signal from the third sensing channel 818 isinput into one of the two wave morphology analysis units (e.g., wavemorphology analysis unit 840 in FIG. 8) of the third event detector 822,and the signal from the fourth sensing channel 820 is input into theother of the two wave morphology analysis units (e.g., wave morphologyanalysis unit 848 in FIG. 8). Each of the inputs from the third sensingchannel 818 and the fourth sensing channel 820 is also introduced into awindow analysis unit (e.g., the signal from the third sensing channel818 is input into window analysis unit 842 in FIG. 8 as well as intowave morphology analysis unit 840, and the signal from the fourthsensing channel 820 is input into window analysis unit 850 as well asinto wave morphology unit 848. Each of the two window analysis units 842and 850 of the third event detector 822 have a line length analysis tool(844 and 852) and an area analysis tool (846 and 854). Thus, there arethree analysis unit outputs associated with one of the two channels inthe third event detector 822 (e.g., third sensing channel 818) and thesame three types of analysis unit outputs associated with the other ofthe two channels in the third event detector 822 (e.g., fourth sensingchannel 820). The three analysis unit outputs associated with eachchannel 818, 820 can be combined via a Boolean “AND” operation 858, 862to produce two different outputs of a first stage of the third eventdetector, 860 and 864, respectively. These two outputs 860 and 864 canbe combined in a second Boolean “AND” operation 868 into a second stageto produce the final output for the third event detector 856.

Depending upon the nature of the signals being sensed and any processingthat is applied to the sensed signals in the event detectors, it may bedesirable to invert one or more outputs before or after the outputs arecombined in a Boolean “AND” operation. For example, with reference tothe third event detector 822, the one of the two outputs of the firststage of the third event detector, i.e., the output 864 in FIG. 8 isshown being inverted in FIG. 8 (as represented in the figure by the“NOT” gate or inverter symbol 866), before the output 864 is furthercombined in a Boolean “AND” operation with the other output of the firststage of the third event detector, i.e., output 860 in FIG. 8, toproduce a second-stage third event detector output 856.

In one variation of an event detector such as the third event detector822 shown in FIG. 8, the event detector can be configured to monitor ordetect a “qualifying event,” such as the occurrence of the REM sleepstate. More particularly, the processing of, and logical operationsapplied to, the data input to the third sensing channel 818 and thefourth sensing channel 820 may be such that the second-stage output ofthe third event detector, i.e., output 856, only is “on” (or “high” or a“1” value as opposed to a “0” value) when a patient is in the REM sleepstate. For example, the input received by the third sensing channel 818may correspond to an EEG signal from the left hemisphere of a patient'sbrain, and the input received by the fourth sensing channel 820 maycorrespond to an EEG signal from the right hemisphere of the patient'sbrain. When both sensing channels 818 and 820 are sensing an EEG signalwith characteristics indicative of the REM sleep state, the third eventdetector 822 can be configured so that the output of the second stage ofthe third event detector (output 856) will be on (or “high” or a “1”value) for so long as the two EEG signals are indicative of REM sleep.In addition, the both first stage outputs of the third event detector(860 and 864) can be independently configured for selectable persistence(i.e., the ability to retain a value indicating the presence of REMsleep some time after the REM sleep state is actually sensed by thethird sensing channel 818 and the fourth sensing channel 820. Thus, thesystem can be configured so that the combination of the two outputs ofthe first-stage of the third event detector, namely, outputs 860 and864, specifically the second-stage output of the third event detector856 (shown in FIG. 8 as the result of the Boolean “AND” operationillustrated by “AND” gate 868), will remain triggered even when there isnot precise temporal synchronization between detections on the sensingchannels.

The EEG signals may be introduced to the sensing channels by amplifyingsignals detected by electrodes capable of sensing electrical activity inthe brain. It will be apparent that the location of the electrodes maybe other than in the right and left hemispheres, and that the signalsreceived by the sensing channels may be other than EEG signals.Moreover, it will be apparent that the same use of the event detectorsof the implantable device, such as the third event detector 822 of FIG.8, can be used to configure one or more “qualifying channels” fordifferent types of signals, and that the output that represents that aqualifying event is occurring or has occurred may reflect use ofsomething other than a Boolean “AND” operation (e.g., a Boolean “OR”operation) to identify that the event is occurring or has occurred.

In one variation, the “qualifying channel” is applied to detect whennoise is occurring on a channel in excess of a certain threshold, sothat the output of the second stage of the third event detector output856 is only “on” when the noise is below that threshold. In anothervariation, the “qualifying channel” is applied to aid in configuring theimplantable device 110, for example, to help determine which of two setsof detection parameters is preferable (by configuring two sensingchannels of an event detector to receive signals each corresponding to adifferent set of parameters on each of two sensing channels of an eventdetector, and then using a Boolean “OR” operation to indicate when whichset of parameters is present on which channel. In still anothervariation, the sensing channels, processing of and logical operations onthe signals can be configured so that a specific temporal sequence ofdetections must be occurring or have occurred in order for the ultimateoutput of the event detector to be “on.” There are numerous otherpossibilities for signal processing and logical operations for the eventdetectors of the implantable device 110. For example, a first eventdetector output 834, a second event detector output 838 and a thirdevent detector output 856 may be represented by Boolean flags and, asdescribed below, provide information useful for the operation of theimplantable devices 110.

While FIG. 8 illustrates four different sensing channels providing inputto three event detectors, it should be noted that in a maximallyflexible variation, each sensing channel would be allowed to connect toone or more event detectors. It may be advantageous to program (usinghardware, firmware, software, or some combination thereof) the differentevent detectors with different settings (e.g., thresholds) to facilitatealternate “views” of the same sensing channel data stream.

FIG. 9A shows three different graphs of a waveform (amplitude vs. time)of the type that may be detected by the implantable devices 110described herein. In the top graph of FIG. 9A, the waveform 910 isrepresentative of an unprocessed EEG or ECoG waveform having asubstantial amount of variability; the illustrated segment has aduration of approximately 160 ms and a dominant frequency (visible asthe large-scale crests and valleys) of approximately 12.5 Hz. It will berecognized that the first waveform is rather rough and characterized bymany peaks of small amplitude and duration; there is a substantialamount of high-frequency energy represented therein.

The middle graph of FIG. 9A shows the waveform of the top graph after ithas been filtered to remove most of the high-frequency energy In themiddle graph, the waveform 912 is significantly smoother than thewaveform 910 shown in the top graph. The filtering operation may beperformed in the sensing front end 512 before the analog-to-digitalconverters 612 (FIG. 6). The filtered waveform 912 then can be sampledby one of the analog-to-digital converters 612. The result of such asampling operation is represented graphically in the bottom waveform 914shown in FIG. 9A. As illustrated, a sample rate used in one variation is250 Hz (4.0 ms sample duration), resulting in approximately 40 samplesover the illustrated 160 ms segment. As is well known in the art ofdigital signal processing, the amplitude resolution of each sample islimited. In FIG. 9A, each sample was measured with a resolution of 10bits (or 1024 possible values). As is apparent upon visual analysis ofthe third waveform, the dominant frequency component has a wavelength ofapproximately 20 samples, which corresponds to the dominant frequency of12.5 Hz. For sleep staging, a filtering operation may be performed inthe sensing front end 512 before the analog-to-digital converters 612(FIG. 6). For example, in sleep staging applications, a band pass filtermay be set in the range of about 0.5 Hz to about 20 Hz.

With respect to sleep staging, exemplary waveforms generally associatedwith a sleeping person are shown in FIGS. 9B-9D. In FIG. 9B, an ECoGtracing shows a slow delta wave 916 associated with sleep, FIG. 9C showsa theta wave 918, and FIG. 9D shows an alpha wave 920. Each waveform isapproximately three seconds long. If a sampling rate of 250 Hz is used,each waveform results in approximately 750 samples. The dominantfrequency component in each of FIGS. 9B, 9C, and 9D is approximately 2.5Hz, 5.0 Hz and 10 Hz, respectively.

Method for Detecting Sleep Stages

Sleep is characterized by alternating periods of highly active rapid eyemovement episodes (REM) and quiet non-REM (NREM) episodes, which arecharacterized by increased power in the low-frequency bands of thedetectable EEG or EcoG waveforms. The implantable devices described hereare capable of distinguishing between six discrete states or stages ofsleep depth: wake (W), rapid eye movement (REM), stage 1 (S1), stage 2(S2), stage 3 (S3), and stage 4 (S4), where S1 is a state of drowsinessor transition between wake and sleep, S2 is a state of light sleep, andS3 and S4 are two different stages characteristic of deep sleep. Theimplantable devices may include one or more sensors configured to sense(continuously or intermittently) the electrical activity of the brain orother physiological information. In some instances, the implantabledevices may include at least two sensors for sensing physiologicalinformation. When at least two sensors are employed, the sensors maysense the same or different types of physiological information.

There are specific, well-known waveforms associated with EEG signalsrecorded during different sleep states and stages. For example, alpha,beta, theta, and delta waves are distinguished by the frequency rangesover which they occur and/or amplitude (alpha: 8-12 Hz, 20-100microvolts; beta: 14-30 Hz and low voltage, on the order of 20microvolts; theta: 4-7.5 Hz, usually under 20 microvolts; and delta:0.5-3.5 Hz). Certain waveform morphology is also characterized by theterm “k-complexes” (an EEG wave having a sharp negative front followedby a positive component) and “sleep spindles” (bursts of 12-14 Hzactivity often occurring with a k-complex). There is a mix of alpha,beta, and higher frequency waveforms during wake. During Stage 1, alphaactivity drops to less than 50% of the total power of the signal. andtransitions to theta. Stage 1 is usually brief, lasting about one toabout seven minutes. Stage 2 is predominantly associated with thetaactivity with little to no alpha activity. Delta activity usuallyappears in less than 20% of the EEG record monitored during Stage 2sleep. The amplitude of the waveforms may also increase from Stage 1.With respect to Stage 3, delta activity with high peak-to-peakamplitudes for about 20% to about 50% of the epoch, k-complexes, andspindles may be seen, and during Stage 4, slow delta activity for morethan about 50% of the epoch may be seen. REM is associated with mixedfrequency waveforms, slow alpha activity, and alpha spindles shorterthan three seconds.

The method for detecting sleep stages disclosed herein is related to theGotman system of analyzing EEG waveforms (J. Gotman, Automatic SeizureDetection: Improvements and Evaluation, Electroencephalogr. Clin.Neurophysiol. 76(4):317-324 (1990)), as previously described in U.S.Pat. No. 6,810,285 to Pless et al., which is hereby incorporated byreference in its entirety. In the Gotman system, EEG waveforms arefiltered and decomposed into “features” representing characteristics ofinterest in the waveforms. One such feature is characterized by theregular occurrence (i.e., density) of half waves that exceed a thresholdamplitude occurring in a specified frequency band, especially incomparison to background activity.

Analyzing half wave activity can be used to detect when certain sleepstages are occurring. Much of the processing performed by theimplantable devices described here involves operations on digital datain the time domain. To reduce the amount of data processing required bythe implantable devices, preferably samples at ten-bit resolution aretaken at a rate less than or equal to approximately 500 Hz (2.0 ms persample).

Referring now to FIG. 10A, the processing of the wave morphologyanalysis units 712 is described in conjunction with a filtered andsampled waveform 1010 of the type illustrated as the bottom waveform 914shown in FIG. 9A. In a first half wave 1012, which is partiallyillustrated in FIG. 10A (the starting point occurs before theillustrated waveform segment 1010 begins), the waveform segment 1010 isessentially monotonically decreasing, except for a small firstperturbation 1014. Accordingly, the first half wave 1012 is representedby a vector from the starting point (not shown) to a first localextremum 1016, where the waveform starts to move in the oppositedirection. The first perturbation 1014 is of insufficient amplitude tobe considered a local extremum, and is disregarded by a hysteresismechanism (discussed in further detail below). A second half wave 1018extends between the first local extremum 1016 and a second localextremum 1020. Again, a second perturbation 1022 is of insufficientamplitude to be considered an extremum. Likewise, a third half wave 1024extends between the second local extremum 1020 and a third localextremum 1026; this may appear to be a small perturbation, but isgreater in amplitude than a selected hysteresis threshold. The remaininghalf waves 1028, 1030, 1032, 1034, and 1036 are identified analogously.As will be discussed in further detail below, each of the identifiedhalf waves 1012, 1018, 1024, 1028, 1030, 1032, 1034, and 1036 has acorresponding duration 1038, 1040, 1042, 1044, 1046, 1048, 1050, and1052, respectively, and analogously, a corresponding amplitudedetermined from the relative positions of each half wave's startingpoint and ending point along the vertical axis, and a slope direction,either increasing or decreasing.

In one variation, the method allows for a programmable hysteresissetting in identifying the ends of half waves. In other words, asexplained above, the end of an increasing or decreasing half wave mightbe prematurely identified as a result of quantization (and/or othernoise, low-amplitude signal components, and other perturbing factors),unless a small hysteresis allowance is made before the reversal of thewaveform direction is recognized and a corresponding half wave end isidentified. Hysteresis allows for insignificant variations in signallevel that are inconsistent with the signal's overall movement to beignored without the need for extensive further signal processing such asfiltering. Without hysteresis, such small and insignificant variationsmight lead to substantial and gross changes where half waves areidentified, leading to unpredictable results.

In one variation of sleep stage detection, if both the amplitude andduration qualify by exceeding a corresponding preset minimum thresholdand qualify by not exceeding a preset maximum threshold, then theamplitude, duration, half-wave time, and half-wave direction are storedin a buffer. Adding a maximum half-wave width parameter can furtherspecify the minimum frequency in a range of frequencies. A maximumamplitude threshold allows the exclusion of high amplitude half wavesthat are often characteristic of seizures or other non-sleep activity.For example, as shown in FIG. 10B, the half wave with an amplitude 1055and duration 1058 may be classified as a theta-type half wave, whereas ahalf wave with an amplitude 1056 and duration 1059 may be classified asa delta-type half wave. The half wave with amplitude 1057 and duration1060 may be not satisfy the necessary amplitude criterion so it is notincluded in any histogram that might be generated using the dataacquired or processed.

Processing that can be performed with regard to the waveform 1010 andhalf waves shown in FIGS. 10A and 10B are illustrated in a flow chart inFIG. 11. First, an increasing half wave is identified (i.e., a half wavewith an ending amplitude that is higher than its starting amplitude), asin the second half wave 1018 of FIG. 10A). To accomplish this, initialvalues are assigned to several variables, namely, half-wave time (1110)(half-wave time corresponds to the time that elapses between adjacentqualifying half waves.) half-wave duration, peak amplitude, first samplevalue, and ending threshold (1112) Specifically, the half-wave time andhalf-wave duration value is set to zero; the peak amplitude and firstsample values are set to the amplitude value of the last-observed sample(which, as described above, is a value having 10-bit precision); and theending threshold is set to the last observed sample minus a small presethysteresis value.

When an EEG sample is acquired (1114), the half-wave time and half-waveduration variables are incremented (1116). If amplitude of the EEGsample is greater than the value of the peak amplitude variable (1118),then the amplitude of the half wave is increasing. If the half wave isincreasing, the peak amplitude variable is reset to correspond to theamplitude of the EEG signal and the ending threshold is reset to a valuecorresponding to the amplitude of the EEG signal less a predeterminedsmall hysteresis value, and the next EEG sample is awaited (1114). Ifthe amplitude of the EEG sample is less than the ending threshold(1122), then the hysteresis value has been exceeded, and a localextremum has been identified. Accordingly, the end of the increasinghalf wave has been reached. At this point, the amplitude and duration ofthe half wave are calculated (1124). The amplitude of the half wave isthe peak amplitude minus the amplitude of the first EEG sample value,and the duration is simply the duration of the detected half wave. Ifthe local extremum is not yet identified, the next EEG sample is awaitedand the process is repeated on that sample (1114). In one variation, ifboth the amplitude and the duration qualify by both exceedingcorresponding preset minimum thresholds but not exceeding preset maximumthresholds (1126), then the amplitude, duration, half-wave time, andhalf-wave direction (increasing) are stored in a buffer (1128), and thehalf-wave time is reset to zero (1130). However, in other variations(not shown), multiple amplitude and duration threshold comparisons mightbe simultaneously performed on the same half wave to simultaneouslydetermine delta, theta, and alpha components. For example, and referringnow to FIG. 10B, a half wave with illustrated amplitude 1056 andduration 1059 may not satisfy the criterion for alpha, but may satisfythe criterion for theta. The parameters for this half wave may then bestored in a buffer for theta. Multiple buffers may also be provided tostore parameters, e.g., if different frequency bands are employed. Inanother variation, multiple half-wave detectors may be configured to runin parallel so that parameters for each detector correspond to aspecific frequency band.

Once an increasing half wave is detected, the half-wave duration, thepeak amplitude, the first sample value, and ending threshold variablesare initialized again (1132). Half-wave duration is set to zero, thepeak amplitude and the first sample value are set to the most recentsample value, and the ending threshold is set to the last sample valueplus the hysteresis value and the next EEG sample is awaited (1134), thehalf-wave time and half-wave duration variables are incremented (1136).If the amplitude of the EEG sample is lower than the peak amplitude(1138), then the direction of the half wave is decreasing. Accordingly,the peak amplitude is reset to the amplitude of the current EEG sample,and the ending threshold is reset to correspond to the amplitude of thecurrent EEG sample plus the hysteresis value (1140), and the next sampleis awaited (1134).

If the amplitude of current EEG sample is greater than the endingthreshold (1142), then the hysteresis value has been exceeded, and alocal extremum has been identified. Accordingly, the end of thedecreasing half wave has been reached, and the amplitude and duration ofthe half wave are calculated (1144). The amplitude is the first samplevalue minus the peak amplitude, and the duration is the duration of thehalf wave in the current EEG sample. If the extremum is not identified,the next EEG sample is awaited (1134). If both the amplitude and theduration qualify by exceeding corresponding preset minimum thresholdsbut not exceeding a preset maximum thresholds (1146), then theamplitude, duration, half-wave time, and half-wave direction(decreasing) are stored in a buffer (1148), and the half-wave time isreset to zero (1150).

Once a decreasing half wave is identified, the above-describedoperations are repeated to identify additional half waves (1112).Parameters corresponding to qualifying half waves, including theirdirections, durations, amplitudes, and the elapsed time between adjacentqualified half waves (i.e., the half-wave time variable) are stored.Half wave detection is an ongoing and continuous process, but the halfwave detection operations may be suspended from time to time whenconditions or device state call for it, e.g. when the implantable deviceis inactive or, if the implantable device is configured to deliverstimulation or some other therapy, when the stimulation or the othertherapy is being performed. The half wave detection procedure can beresumed after it has been suspended at the first initializationoperation (1110).

In one variation, to reduce power consumption, the half wave detectionoperations are performed in customized electronic hardware. Preferably,the operations of FIG. 11 are performed in parallel whenever the wavemorphology analysis units 712 (FIG. 7) are active.

Software operations can also be carried out on a periodic basis toprovide useful information about the physiological information beingmonitored. In one variation, and referring now to FIG. 12, the storedinformation associated with the qualifying half waves is processed todefine sleep states or stages by the ratio or absolute quantity ofdelta, theta or alpha waves detected within a certain period of time.More specifically, the software process involves clearing a half-wavewindow flag (1210), identifying the qualifying half waves detectedduring the chosen period of time (1212), associating a “current halfwave” variable with the oldest detected half wave in the chosen periodof time (1214), and using a histogram counter to track the time intervalbetween the most recent half wave detected and prior detected half waves(1216). The chosen period of time can be a defined processing window(e.g., a recurring time interval that is either fixed or programmable).For example, a 128 ms processing window may be selected which, at a 250Hz sampling rate, would be expected to correspond to 32 EEG samples.

The histogram counter tracks the time interval between the most recenthalf wave detected and the prior half waves are then measured, where x1is the number of half waves to be identified within a selected half-wavetime window (the duration of the half-wave time window is anotherprogrammable value) for the first event detector 812, and x2 is thenumber of half waves within the same half-wave time window for thesecond event detector 816, and likewise for x3 and the third eventdetector 822. Detection of an event may be defined as the occurrence ofthe condition when x1 is greater than a prespecified value, or when theratio of any combination of x (e.g., x1 and x2) is greater than aprespecified value.

A histogram counter may be included in the detection subsystem (FIG. 4)to keep track of the detections within each frequency band, providing ameasure of the average low-frequency power in the signal over a periodof time. The number detections within each frequency band over aspecified time window (for example, a sliding window of 1-10 minutes)then could be used to classify which sleep stage occurred for that timeperiod. Transitions are noted when the number of detections within oneband decreases and in another band increases.

Sleep stages may be detected by using a set of low frequency half-wavecounters simultaneously detecting waveforms in the EEG samples. Forexample, these counters may be set up to detect the waveform activity inthe frequency range of 0.5 Hz-3.5 Hz for the delta band, 4.0 Hz-7.5 Hzfor the theta band, and 8.0 Hz-12 Hz for the alpha band. Line length andarea detectors may also be implemented to measure the overall complexityand power of the signal. Sleep stages may then be characterized by theratio or absolute quantity of delta, theta, alpha within a period oftime. For example, in the histogram shown in FIG. 23, the number ofdelta half wave counts (on the y-axis) are binned into brief timewindows (on the x-axis) between about 10 seconds to about one minute.When the number of half waves within a window exceeds a threshold x, aparticular sleep stage may be detected. For example, if between about 10and about 25 half waves are detected in a 10 second window, then sleepStage 3 is detected; and if greater than 25 delta half waves aredetected per 10 second window, then sleep Stage 4 is detected. REM,wake, and sleep Stages 1 and 2 may be determined in a similar manner bycharacterization of alpha and theta waves. The thresholds may beindependently adjusted to optimally tune the sleep stage detector toeach individual patient. Algorithms, such as one that calculates theratio between different frequency bands (e.g., the ratio between deltaand theta), may also be employed.

The event detectors detectors may be configured in any manner suitableto monitor sleep or detect sleep states or stages. In one variation, asingle wave morphology analysis unit is used to detect half waves. Inanother variation, where multiple waveform morphology analysis are used,they may be set up in parallel to each frequency band of interest. Halfwaves within a specific duration and amplitude range may then be binnedinto appropriate bins in a histogram.

The time interval between the most-recently detected half wave and xpreviously-detected half waves is then tested against a selectedhalf-wave time window (1216), where x is a specified minimum number ofhalf waves (preferably a programmable value) to be identified within andthe half-wave time window The half-wave time window is desirablyselected to correspond to the time over which detection of a certainsleep state or stage, or might be expected to occur. If the measuredtime interval is less than the half-wave time window (1218), then thehalf-wave window flag is set (1220). Logic inversion is then selectivelyapplied (1222) to determine whether a wave morphology analysis unit (orother analyzer) is triggered by the presence or absence of a condition,as explained in greater detail below. If the measured time interval isgreater than or equal to the half-wave time window, the value of thehalf wave pointer is incremented to point to the next new half wave(1228) If there are no more new half waves (1230), logic inversion isapplied if desired (1222), and the procedure ends (1224). If there aremore new half waves, the next time interval is tested (1216) and theprocess continues from there.

Logic inversion allows the output flag for the wave morphology analysisunit (or any other analyzer) to be selectively inverted. If logicinversion is applied to an output of a particular analysis unit, thenthe corresponding flag will remain cleared when the detection criterion(e.g., number of qualifying half waves) is met, and will be set when thedetection criterion is not met. This capability provides some additionalflexibility in configuration, facilitating detection of the absence ofcertain signal characteristics when, for example, the presence of thosecharacteristics is the norm.

In one variation, the half-wave window flag is used to indicate whetherthe number of qualifying half waves exceeding a predetermined value hasoccurred over an interval the endpoint of which corresponds to the endof the most recent processing window. To reduce the occurrence ofspurious detections, an X-of-Y criterion is applied to preventtriggering the wave morphology analysis unit unless a sufficient numberof qualifying half waves occur in X of the Y most recent processingwindows, where X and Y are parameters individually adjustable for eachanalysis unit. Referring now to FIG. 13, a sum representing recentprocessing windows in which the half-wave window flag was set is clearedto zero and a current window pointer is initialized to point to the mostrecent processing window (1310). If the half-wave window flagcorresponding to the current window pointer is set (1312), then the sumis incremented (1314). If there are more processing windows to examine(for an X-of-Y criterion, a total of Y processing windows, including themost recent, should be considered) (1316), then the window pointer isdecremented (1318) and the flag testing and sum incrementing steps(1312-1314) are repeated. After Y windows have been considered, if thesum of windows having set half-wave window flags meets the thresholdX(1320), then the half-wave analysis flag is set (1322), persistence(described below) is applied (1324), and the procedure is complete.Otherwise, the half wave analysis flag is cleared (1326).

Persistence, another per-analysis-tool setting, allows the effect of anevent detection (a flag set) to persist beyond the end of the detectionwindow in which the event occurs. Persistence may be set anywhere fromone to fifteen seconds (though other settings are possible), so ifdetections with multiple analysis tools (e.g., multiple wave morphologyanalysis units or multiple event detectors) do not all occursimultaneously (though they should still occur within a fairly shorttime period), a Boolean combination of flags will still yield positiveresults. Persistence can also be used with a single analysis tool tosmooth the results.

When the process of FIG. 13 is completed, the half-wave analysis flag(set or cleared in steps 1322 and 1326, respectively) indicates whetheran event has been detected in the corresponding channel of the wavemorphology analysis units 712 or, stated another way, whether asufficient number of qualifying half waves have appeared in X of the Ymost recent processing windows. Although in the variations shown inFIGS. 12 and 13, the operations are performed in software, it should berecognized that some or all of those steps can be performed usingcustomized electronics, if it proves advantageous in the desiredapplication to use such a configuration (e.g., to optimize thecomputational power that is required to carry out the operations in theimplantable device).

In some instances, it may be desirable to include either or both a linelength detector and an area detector for sleep staging. For example,these features may be useful when the amplitude of the EEG sample ishigh and/or the signal is complex, as may occur during the REM stage orduring deep sleep or “slow wave” sleep (Stages 3 and 4). In theinstances of increasing amplitude, the high amplitude of the slow wavemay be detected using an area detector alone or in combination with ahalf wave detector. Similarly, in REM sleep there may be an increase insignal complexity that can be detected using a line length detectoralone or in conjunction with a half wave detector.

FIG. 14 illustrates the filtered waveform of FIG. 9A, further depictingline lengths identified within a time window. The time window selectedmay be the same as or different from the selected half-wave processingwindow. From an implementation standpoint, a single device interruptupon the conclusion of each processing window allows all of the analysistools to perform the necessary corresponding software processes; theline length analysis process of FIG. 16 (described below) is one suchexample. The waveform 1410 shown in FIG. 14 is a filtered and otherwisepreprocessed EEG signal as received by one of the window analysis units714 from the sensing front end 512. As discussed above, line lengths areconsidered within time windows. The duration of the time window 1412shown in FIG. 14 is 128 ms which, at a 250 Hz sampling rate correspondsto an expected 32 samples. Other time windows and sampling rates can bespecified as appropriate.

The total line length for the time window 1412 is the sum of thesample-to-sample amplitude differences within that window 1412. Forexample, the first contribution to the line length within the window1412 is a first amplitude difference 1414 between a previous sample 1416occurring immediately before the window 1412 and a first sample 1418occurring within the window 1412. The next contribution comes from asecond amplitude difference 1420 between the first sample 1418 and asecond sample 1422; a further contribution 1424 comes from a thirdamplitude difference between the second sample 1422 and a third sample1426, and so on. At the end of the window 1412, the final contributionto the line length comes from a last amplitude difference 1430 between asecond-last sample 1432 in the window 1412 and a last sample 1434 in thewindow 1412. Note that all line lengths, whether increasing ordecreasing in direction, are accumulated as positive values. Adecreasing amplitude difference 1414 and an increasing amplitudedifference 1428 therefore both contribute to a greater line length.

The flow chart of FIG. 15 describes how the line length is calculated.At the beginning of a time window, a “line length total” variable isinitialized to zero (1510). An EEG sample is awaited (1512), and theabsolute value of the difference in amplitude between the current EEGsample and the previous EEG sample (which, when considering the firstsample in a window, may come from the last sample in a previous window)is measured (1514). Then, the previous sample (if any) is replaced withthe value of the current sample (1516), and the calculated absolutevalue is added to the total (1518). If there are more samples remainingin the window 1412 (1520), another current sample is awaited (1512) andthe method continues. Otherwise, the line length calculation for thewindow 1412 is complete, and the total is stored (1522), the total isreinitialized to zero (1510), and the method continues.

In other variations, either the measured amplitude difference(calculated as described above (1514)) or the sample values used tocalculate the measured amplitude difference may be mathematicallytransformed in useful nonlinear ways. For example, it may beadvantageous in certain circumstances to calculate the differencebetween adjacent samples using the squares of the sample values, or tocalculate the square of the difference between sample values, or both.It is contemplated that other transformations (such as square root,exponentiation, logarithm, and other nonlinear functions) might also beadvantageous in certain circumstances. Whether such a transformation isperformed and the nature of any transformation to be performedpreferably are programmable parameters of the implantable device 110.

As with the half wave analysis method set forth above, the line lengthcalculation does not need to terminate, rather, it can be configured tobe free-running yet interruptible. If the line length calculation isrestarted after having been suspended, it should be reinitialized andrestarted at the beginning of a time window. This synchronization maybeaccomplished through hardware interrupts.

Referring now to the flow chart of FIG. 16, the calculated line lengthsare further processed after the calculations for each time window 1412are obtained and stored. The process begins by calculating a runningaccumulated line length total over a period of n time windows. Wheren>1, the effect is that of a sliding window. (Indeed, in one variation,true sliding-window processing is used). The accumulated total variableis first initialized to zero (1610). A current window pointer is set toindicate the nth to the last window, i.e., the window (n−1) windowsbefore the most recent window (1612). The line length of the currentwindow is added to the total (1614), the current window pointer isincremented (1616), and if there are more windows between the currentwindow pointer and the most recent (last) window (1618), the adding andincrementing steps (1614-1616) are repeated. Accordingly, by thismethod, the resulting total includes the line lengths for each of the nmost recent windows.

In one variation, the accumulated total line length is compared to adynamic threshold, which is based on a trend of recently observed linelengths. The trend is recalculated regularly and periodically, aftereach recurring line-length trend interval (which is preferably a fixedor programmed time interval). Each time the line-length trend intervalpasses (1620), the line length trend is calculated or updated (1622). Inone variation, this is accomplished by calculating a normalized movingaverage of several trend samples, each of which represents severalconsecutive windows of line lengths. A new trend sample is taken and themoving average is recalculated upon every line length trend interval.The number of trend samples used in the normalized moving average andthe number of consecutive windows of line length measurements per trendsample both are preferably fixed or programmable values.

After the line length trend has been calculated, the line lengththreshold is calculated (1624) based on the new line length trend. Thethreshold may be set as either a percentage of the line length trend(either below 100% for a threshold that is lower than the trend or above100% for a threshold that is higher than the trend) or alternatively asa fixed numeric offset from the line length trend (either negative for athreshold that is lower than the trend or positive for a threshold thatis higher than the trend). It should be observed that other methods forderiving a numeric threshold from a numeric trend are possible.

The first time the process of FIG. 16 is performed, there is generallyno line length trend against which to set a threshold. Accordingly, forthe first several passes through the process (until a sufficient amountof EEG data has been processed to establish a trend), the threshold isessentially undefined and the line length detector should not return apositive detection. Some “settling time” is required to establish trendsand thresholds before a detection can be made. If the accumulated linelength total exceeds the calculated threshold (1626), then a flag is set(1628) indicating a line-length-based event detection on the currentwindow analysis unit channel 714. As described above, the threshold isdynamically calculated from a line length trend, but alternatively, thethreshold may be static, either fixed or programmed into the implantabledevice 110. If the accumulated line length total does not exceed thethreshold, the flag is cleared (1630).

Once the line length flag has been either set or cleared, logicinversion is applied (1632), persistence is applied (1634), and theprocedure terminates. The resulting persistent line length flagindicates whether the threshold has been exceeded within one or morewindows over a time period corresponding to the line length flagpersistence. As will be discussed in further detail below, line lengthevent detections can be combined with the half-wave event detections, aswell as any other applicable detection criteria.

FIG. 17 illustrates the filtered waveform of FIG. 9A with area under thecurve identified within a window. Area under the curve, which in somecircumstances is somewhat representative of a signal's energy (thoughenergy of a waveform is more accurately represented by the area underthe square of a waveform), may be another criterion for detectingcertain events occurring with respect to the physiological informationbeing monitored by the implantable device. In FIG. 17, the total areaunder the curve represented by a waveform 1710 within the window 1712 isequal to the sum of the absolute values of the areas of each rectangularregion of unit width vertically bounded by the horizontal axis and theEEG sample. For example, the first contribution to the area under thecurve within the window 1712 comes from a first region 1714 between afirst sample 1716 and a baseline 1717. A second contribution to the areaunder the curve within the window 1712 comes from a second region 1718,including areas between a second sample 1720 and the baseline 1717.There are similar regions and contributions for a third sample 1722 andthe baseline 1717, a fourth sample 1724 and the baseline 1717, and soon. (From a mathematical standpoint, the region widths are notsignificant to the area calculation; rather, the area can be consideredthe product of the amplitude or the region and a region unit width,which can be disregarded.) Although the concept of separate rectangularregions is a useful construct for visualizing the idea of area under acurve, any process for calculating area need not partition areas intoregions as such regions are shown in FIG. 17.

Referring now to the flow chart of FIG. 18, the areas under the curveshown in the graph of FIG. 17 are calculated using a process that isinvoked at the beginning of a time window. Initially, an “area total”variable is initialized to zero (1810). The current EEG sample isawaited (1812), and the absolute value of the current EEG sample ismeasured (1814). As with the line length calculation method describedabove in other variations, the current EEG sample may be mathematicallytransformed in useful nonlinear ways. For example, it may beadvantageous in certain circumstances to calculate the square of thecurrent sample rather than its absolute value. The result of such atransformation by squaring each sample will generally be morerepresentative of signal energy, though it is contemplated that othertransformations (such as square root, exponentiation, logarithm, andother nonlinear functions) might also be advantageous in certaincircumstances. Whether such a transformation is performed and the natureof any transformation performed both preferably are programmableparameters of the implantable device 110.

The calculated absolute value is added to the total (1816). If there aremore EEG samples remaining in the window 1712 (step 1818), anothercurrent sample is awaited (1812) and the process continues. Otherwise,the area calculation for the window 1712 is complete, and the total isstored (1820), the total is reinitialized to zero (1810), and the methodcontinues. As with the half wave and line length analysis methods setforth above, the area calculation does not need to terminate, rather, itcan be configured to be free-running yet interruptible. If the areacalculation is restarted after having been suspended, it should bereinitialized and restarted at the beginning of a window. Thissynchronization can be accomplished through hardware interrupts.

Referring now to the flow chart of FIG. 19, the area calculations areprocessed. As is accomplished for the line length calculations, the areadetection method begins by calculating a running accumulated area totalover a period of n time windows. Again, where n>1, the effect is that ofa sliding window. The accumulated total is initialized to zero (1910). Acurrent window pointer is set to indicate the nth to the last window,i.e., the window (n−1) windows before the most recent window (1912). Thearea for the current window is added to the total (1914), the currentwindow pointer is incremented (1916), and if there are more windowsbetween the current window and the most recent (last) window (1918), theadding and incrementing steps (1914-1916) are repeated. Accordingly, bythis process, the resulting total includes the areas under the curve foreach of the n most recent windows.

In one variation, the accumulated total area is compared to a dynamicthreshold, which is based on a trend of recently observed areas. Thetrend is recalculated regularly and periodically, after each recurringarea trend interval (which is preferably a fixed or programmed timeinterval). Each time the area trend interval passes (1920), the areatrend is calculated or updated (1922). In one variation, this isaccomplished by calculating a normalized moving average of several trendsamples, each of which represents several consecutive windows of areas.A new trend sample is taken and the moving average is recalculated uponevery area trend interval. The number of trend samples used in thenormalized moving average and the number of consecutive windows of areameasurements per trend sample both are preferably fixed or programmablevalues.

After the area trend has been calculated, the area threshold iscalculated (step 1924) based on the new area trend. As with line length,discussed above, the threshold may be set as either a percentage of thearea trend (either below 100% for a threshold that is lower than thetrend or above 100% for a threshold that is higher than the trend) oralternatively a fixed numeric offset from the area trend (eithernegative for a threshold that is lower than the trend or positive for athreshold that is higher than the trend).

Again, as is the case with the line length detection method, the firsttime the process described in FIG. 19 is performed, there is generallyno area trend against which to set a threshold. Accordingly, for thefirst several passes through the process (until a sufficient amount ofEEG data has been processed to establish a trend), the threshold isessentially undefined and the area detector should not return a positivedetection. Some “settling time” is required to establish trends andthresholds before a detection can be made.

If the accumulated total exceeds the calculated threshold (1926), then aflag is set (1928) indicating an area-based event detection on thecurrent window analysis unit channel 714. Otherwise, the flag is cleared(1930). Once the area flag has been either set or cleared, logicinversion is applied (1932), persistence is applied (1934), and theprocedure terminates. The resulting persistent area flag indicateswhether the threshold has been exceeded within one or more windows overa time period corresponding to the area flag persistence. As will bediscussed in further detail below, area event detections can be combinedwith the half-wave event detections, line-length event detections, aswell as any other applicable detection criteria described herein.

In one variation, each threshold for each channel and each analysis toolcan be programmed separately. (“Tool” as used herein refers to an aspectof a unit, for example, the window analysis unit includes the linelength analysis tool and the area analysis tool.) Therefore, a largenumber of individual thresholds may be used in the method for monitoringphysiological information relating to sleep with an implantable device110. It should be noted thresholds can vary widely and they can bechanged and/or updated by a physician to meet the needs of an individualpatient via the external programmer 312 (FIG. 3), and some analysis unitthresholds (e.g., line length and area) can also be automatically varieddepending on observed trends in the data. This is preferablyaccomplished based on a moving average of a specified number of windowobservations of line length or area, adjusted as desired via a fixedoffset or percentage offset, and may compensate to some extent fordiurnal and other normal variations in brain electrophysiologicalparameters.

The methods described by the flow charts of FIGS. 11-13, 15-16, and18-19 can be implemented in different ways. For example, state machines,software, hardware (including ASICs, FPGAs, and other customelectronics), and various combinations of software and hardware, are allsolutions that would be possible to practitioners of ordinary skill inthe art of electronics and systems design. Since minimizing thecomputational load on the processor is often desirable, certainoperations can be implemented using hardware or a combination ofhardware and software, rather than software alone.

As described previously in connection with FIG. 13, one of the detectionschemes set forth above (i.e., half wave detection) is adapted to use anX-of-Y criterion to weed out spurious detections. This can beimplemented via a shift register or, alternatively, by more efficientcomputational methods. Half waves can be analyzed on a window-by-windowbasis, and the window results can be updated with respect to a separateanalysis window interval. If the detection criterion (i.e., a certainnumber of half waves in less than a specified time period) is met forany of the half waves occurring in the most recent window, thendetection is satisfied within that window. If that occurs for at least Xof the Y most recent windows, then this indicates that the half wavedetection sought was, in fact, detected. If desired, X-of-Y criterioncan be used with other detection algorithms (such as line length andarea such that if thresholds are exceeded in at least X of the Y mostrecent windows, then the corresponding analysis unit triggers adetection. Also, in the described variations, each detection flag, afterbeing set, remains set for a selected amount of time, allowing them tobe combined by Boolean logic (as described below) without necessarilybeing simultaneous.

As indicated above, each of the software processes set forth above(FIGS. 12-13, 16, and 19) correspond to functions performed by the wavemorphology analysis units 712 and window analysis units 714. Each one isinitiated periodically, typically once per a window with a length thatis predetermined (1212, 1512). The outputs from the half wave and windowanalysis units 712 and 714, namely the flags generated in response tocounted qualifying half waves, accumulated line lengths, and accumulatedareas, are combined to identify event detections as functionallyillustrated in FIG. 8 and as described via flow chart in FIG. 20.

The process begins with the receipt of a timer interrupt (2010), whichis typically generated on a regular periodic basis to indicate the edgesof successive time windows. Accordingly, in a method according to thedisclosed embodiment of the invention, such a timer interrupt isreceived every 128 ms, or as otherwise programmed or designed. Then thelatest data from the half wave (2012, FIGS. 12-13), line length (2014,FIG. 16), and area (2016, FIG. 19) detection processes are evaluated,via the half-wave analysis flag, the line-length flag, and the area flagfor each active sensing channel. The steps of checking the analysistools (2012, 2014, and 2016) can be performed in any desired order or inparallel, as they are generally not interdependent. It should be notedthat the foregoing analysis tools should be checked for every activechannel (i.e., channels on which data is currently being sensed and/orprocessed), and may be skipped for inactive channels (i.e., detectionchannels not currently in use).

Flags that indicate whether particular signal characteristics have beenidentified in each active channel for each active analysis tool are thencombined into detection channels (2018) as illustrated in FIG. 8. Thisoperation is performed as described in detail below with reference toFIG. 21. Each detection channel is a Boolean “AND” combination ofanalysis tool flags for a single channel, and as disclosed above, theremay be at least eight channels. The flags for multiple detectionchannels are then combined into event detector flags (2020), which areindicative of identified neurological events calling for action by thedevice. As shown in FIG. 20, if an event detector flag is set (2022),then a corresponding action is initiated (2024) by the device. Actionsaccording to the invention can include the presentation of a warning tothe patient, an application of therapeutic electrical stimulation, adelivery of a dose of a drug, an initiation of a device mode change, ora recording of certain EEG signals. It will be appreciated that thereare numerous other possibilities. It is preferred, but not necessary,for actions initiated by a device according to the invention to beperformed in parallel with the sensing and detection operations that aredescribed in detail herein. It should be recognized that the applicationof electrical stimulation to the brain may require suspension of certainof the sensing and detection operations, as electrical stimulationsignals may otherwise feed back into the detection system 422 (FIG. 4),causing undesirable results and signal artifacts.

Multiple event detector flags are possible, each one representing adifferent combination of detection channel flags. If there are furtherevent detector flags to consider (2026), those event detector flags arealso evaluated (2022) and may cause further actions by the device(2024). It should be noted that, in general, actions performed by thedevice (as in 2024) may be in part dependent on a device state. Forexample, even if certain combinations of events do occur, no action maybe taken if the device is in an inactive state.

As described above, and as illustrated in FIG. 20 as step 2018, acorresponding set of analysis tool flags is combined into a detectionchannel flag as shown in FIG. 21 (see also FIG. 8). Initially the outputdetection channel flag is set (2110). Beginning with the first analysistool for a particular detection channel (2112), if the correspondinganalysis tool flag is not set (2114), then the output detection channelflag is cleared (2116).

If the corresponding analysis tool flag is set (2114), the outputdetection channel flag remains set, and further analysis tools for thesame channel, if any (2118), are evaluated. Accordingly, thiscombination procedure operates as a Boolean “AND” operation. That is, ifany of the enabled and active analysis tools for a particular detectionchannel does not have a set output flag, then no detection channel flagis output by the procedure.

An analysis tool flag that is cleared indicates that no detection hasbeen made within the flag persistence period and, for those analysistools that employ an X-of-Y criterion, that such criterion has not beenmet. In certain circumstances, it may be advantageous to also providedetection channel flags with logic inversion. Where a desired criterion(i.e., combination of analysis tools) is not met, the output flag is set(rather than cleared, which is the default action). This can beaccomplished by providing selectable Boolean logic inversion (2120)corresponding to each event detector.

Also as described above, and as illustrated in FIG. 20 (2020), multipledetection channel flags are combined into a single event detector flagas shown in FIG. 22 (see also FIG. 8). Initially the output eventdetector flag is set (2210). Beginning with the first detection channelfor a particular event detector (2212), if the channel is not enabled(2214), then no check is made. If the channel is enabled and thecorresponding detection channel flag is not set (2216), then the outputevent detector flag is cleared (2218) and the combination procedureexits. If the corresponding detection channel flag is set (2216), theoutput event detector flag remains set, and further detection channels,if any (2220), are evaluated after incrementing the channel beingconsidered (2222). This combination procedure also operates as a Boolean“AND” operation, as if none of the enabled and active detection channelshas a set output flag, then no event detector flag is output by theprocedure. It should also be observed that a Boolean “OR” combination ofdetection channels may provide useful information in certaincircumstances. A software or hardware flow chart accomplishing such acombination is not illustrated, but could easily be created by anindividual of ordinary skill in digital electronic design or computerprogramming.

In general, two different data reduction methodologies may be used insleep state or stage detection. Both methods collect data representativeof EEG signals within a sequence of uniform time windows each having aspecified duration. The first data reduction methodology involves thecalculation of a “line length function” for an EEG signal within a timewindow. Specifically, the line length function of a digital signalrepresents an accumulation of the sample-to-sample amplitude variationin the EEG signal within the time window. Stated another way, the linelength function is representative of the variability of the inputsignal. A constant input signal will have a line length of zero(representative of substantially no variation in the signal amplitude),while an input signal that oscillates between extrema from sample tosample will approach the maximum line length. It should be noted thatwhile the line length function has a physical-world analogue inmeasuring the vector distance traveled in a graph of the input signal,the concept of line length as treated herein disregards the horizontal(X) axis in such a situation. The horizontal axis herein isrepresentative of time which, mathematically is not currently believedto be combinable in any meaningful way with information relating to thevertical (Y) axis, generally representative of amplitude, and which inany event would not be expected to contribute anything of interest

The second data reduction methodology involves the calculation of an“area function” represented by an EEG signal within a time window.Specifically, the area function is calculated as an aggregation of theEEG's signal total deviation from zero over the time window, whetherpositive or negative. The mathematical analogue for the area functiondefined above is the mathematical integral of the absolute value of theEEG function (as both positive and negative signals contribute topositive area). Once again, the horizontal axis (time) makes nocontribution to accumulated energy as treated herein. Accordingly, aninput signal that remains around zero will have a small area value,while an input signal that remains around the most positive or mostnegative values will have a high area value.

Both the area and line length functions may undergo linear or nonlineartransformations. An example would be to square each amplitude beforesumming it in the area function. This nonlinear operation would providean output that would approximate the energy of the signal for the periodof time it was integrated. Similarly, linear and nonlineartransformations of the difference between sample values are advantageousin customizing the line length function to increase the effectiveness ofthe implantable device for a specific patient.

The central processing unit receives the line length function and areafunction measurements performed by the detection subsystem, and iscapable of acting based on those measurements or their trends. Featureextraction, specifically the identification of half waves in an EEGsignal, also provides useful information.

The identification of half waves having specific amplitude and durationcriteria allows some frequency-driven characteristics of the EEG signalto be considered and analyzed without the need for computationallyintensive transformations of time-domain EEG signals into the frequencydomain. Specifically, the half wave feature extraction capability of theimplantable devices described herein identifies those half waves in theinput signal having a duration that exceeds a minimum duration criterionbut does not exceed a maximum duration criterion, and an amplitude thatexceeds a minimum amplitude criterion but does not exceed a maximumamplitude criterion. The number of half waves in a time window meetingthose criteria is somewhat representative of the amount of energy in awaveform at a frequency below the frequency corresponding to the minimumduration criterion. Additionally, the number of half waves in a timewindow is constrained somewhat by the duration of each half wave (i.e.,if the half waves in a time window have particularly long durations,relatively fewer of them will fit into the time window). That is, thatnumber is highest when a dominant waveform frequency most closelymatches the frequency corresponding to the minimum duration criterion.

As stated above, the half waves, line length function, and area functionof various EEG signals can be calculated by customized electronicsmodules with minimal involvement by the central processing unit, and areselectively combined in the implantable device to provide detection andprediction of seizure activity, so that appropriate action can then betaken.

A number of other more sophisticated signal processing tools may beincluded in the device design in order to better detect sleep stages.For example, implementing a Fast Fourier transform (FFT) routine in theimplantable device would allow a direct measure of the power spectrumover time. Thresholds for power within each low frequency band ofinterest could be set to identify different stages of sleep. Informationrelated to theoretic measures such as entropy can also be used tomeasure different stages of sleep, as the signal's complexity isinversely correlated with the sleep depth. In addition, synchrony andmutual information between channels can be used as a measure fordetermining sleep stages, as these features have been shown to increasewith the depth of sleep.

Other analytical methods for monitoring physiological informationrelating to sleep include developing individualized detection sets thatare based on each individual patient's EEG signals. This is importantbecause the underlying neurophysiological signals may vary from patientto patient due to electrode location, disease, or pharmacologicaleffects. To implement an individualized detection set, the device mayinclude algorithms for training a model based on artificial neuralnetworks (ANN) or by using Hidden Markov Modeling. This analyticalmethod would require additional input from the user (e.g., the patient'sphysician or clinician), including a training set of signals that havealready been characterized by the user.

Physiological information other than EEG or ECoG signals may be used toprovide supplementary information for sleep staging or, in the absenceof EEG and/or ECoG data, as the primary information for sleep staging.For example signals from an intracranial sensor that monitors of globalcerebral blood flow (CBF) and/or cerebral metabolic rate (CMR) can beincorporated into the implantable device. Global CBF and CMR are reducedduring light sleep (Stage 2) compared to wake (3-10%), and even furtherreduced during deep sleep (25-44%). In addition, if the CBF/CMR sensorsare place appropriately, localized information about CBF and CMR can beused to monitor the patient's state. Other implementations may includetemperature, heart rate, position (including head position), EMG, EOG,and body movement sensors.

Data about low-frequency detections and sleep stages will be availableto the physician when the device is interrogated. In addition,detections may be used to dynamically update therapy parameters in orderto adjust therapy based on the patient's sleep schedule and/or to adjusttherapy based on the patient's sleep state.

Sleep Staging Applications

Sleep stage information derived from the implantable device may be usedto determine the effectiveness of sleep therapies and/or modulatetherapy delivery (e.g., the implantable device may be programmed todeliver a different therapy during sleep and wake or during differentsleep stages). In one variation, therapy may be coordinated with thedetection of a particular sleep stage. For example, cardiac therapy maybe implemented during a specific vulnerable sleep stage to reduce theoccurrence of arrhythmia or ischemia. This information may also providethe patient, physician, or caretaker with information about thepatient's sleep quality (e.g., duration of time to fall asleep, numberof arousals from sleep, duration of time in slow-wave sleep periods, andduration of sleep cycles). A sleep quality index may also be generatedto indicate sleep quality. The sleep quality index may be determinedfrom a number of outputs derived from the sleep staging tools, includingtotal duration of sleep within per 24 hours, the number of arousals pernight, and the duration spent in each sleep stage.

The sleep stage information detected by the implantable devices hereindescribed may also be used to treat various medical conditions (allocatetherapy). For example, it may be used to treat neurological,psychological, cardiac, respiratory, and sleep conditions, or acombination thereof. Specific neurological conditions may includechronic pain, epilepsy, and movement disorders such as Parkinson'sdisease, Tourette's disorder, tremor, and restless leg syndrome.Psychiatric conditions such as depression, anxiety, and bipolar disordermay also be treated. Furthermore, the implantable devices may be used inmethods of treating sleep conditions such as sleep apnea and narcolepsy.

For example, in epilepsy, some seizures occur preferentially during thedrowsy state (Stage 1) or slow-wave sleep (Stage 3 and Stage 4).Therefore, the sleep staging detections may be used to modulatedelivered therapy. For example, high frequency stimulation may bedelivered in response to paroxysmal events during Stage 3 and Stage 4sleep, while low frequency stimulation may be delivered during Stage 2sleep, wake, and REM sleep, when seizures are less likely to occur.

Similarly, sleep disturbances and or disruptions are often associatedwith depression. An implantable sleep staging device may be used tomonitor sleep disruptions and provide feedback to the physician aboutthe patient's sleep quality as another metric of the patient's overallhealth. In addition, there is often a circadian mood cycle withdepression, and an implantable device that could detect sleep stages maybe used to allocate therapy in accordance to the patient's circadiancycle. For example, in patients who have worsening of mood in themorning, increased therapy may be provided in response to the detectionof Stage 1 or the transition from Stage 1 to wake. This may bepreferable to a scheduled increase in therapy dosage since patients mayfollow a different sleep routine from day to day. In addition totreating the mood symptoms, stimulation or drug therapy may also beprovided in response to different sleep stages in order to betterregulate sleep.

In another example, with movement disorders such as Parkinson's diseaseand essential tremor, an implantable device as described herein can beused as a sleep staging detector in conjunction with an implantablestimulator in order to regulate the amount of stimulation a patientreceives during sleep. In some cases, stimulation may be turned off orgreatly reduced when Stage 3 or Stage 4 sleep is detected. Limiting orreducing stimulation when it is not necessary can increase the batterylife of the stimulator.

All publications, patents, and patent applications cited herein arehereby incorporated by reference in their entirety for all purposes tothe same extent as if each individual publication, patent, or patentapplication were specifically and individually indicated to be soincorporated by reference. Although the foregoing implantable devicesand their methods of use have been described in some detail by way ofillustration and example for purposes of clarity of understanding, itwill be readily apparent to those of ordinary skill in the art, in lightof the description herein provided, that certain changes andmodifications may be made thereto without departing from the spirit andscope of the appended claims.

1. A method for monitoring physiological information relating to sleepcomprising: sensing physiological information; detecting a plurality ofhalf waves in the sensed physiological information based on a localmaximum amplitude and a subsequent local minimum amplitude, or based ona local minimum amplitude and a subsequent local maximum amplitude;determining a duration and an amplitude of each half wave of theplurality of detected half waves; binning each half wave into a bin of aplurality of different bins based on the determined duration and theamplitude of said half wave, each bin being characterized by a durationrange having a preset minimum duration and a preset maximum duration andan amplitude range having a preset minimum amplitude and a presetmaximum amplitude; counting, for each bin, a number of occurrences ofhalf waves within said bin; and determining a detection of an occurrenceof at least one sleep state or stage if the number of occurrences ofhalf waves within specified bins correspond to the at least one sleepstate or stage.
 2. The method of claim 1 further comprising storing atleast a portion of the physiological information or the half wavephysiological information.
 3. The method of claim 1 further comprisingtransmitting at least a portion of the physiological information or thehalf wave physiological information to a remote location.
 4. The methodof claim 1 further comprising: determining whether detected occurrencesof the at least one sleep state or stage indicate a physiologicalcondition; and treating the physiological condition.
 5. The method ofclaim 4, wherein the physiological condition is selected from the groupconsisting of a neurological condition, a psychological condition, acardiac condition, a respiratory condition, and a sleep condition. 6.The method of claim 4, wherein treating the physiological conditioncomprises providing stimulation to a patient.
 7. The method of claim 6,wherein providing stimulation comprises selecting stimulation based onwhich at least one sleep state or stage is detected.
 8. The method ofclaim 7, wherein selecting stimulation comprises selecting thefrequency, pulse-width, amplitude, duration, or the stimulation montage.9. The method of claim 7, wherein selecting stimulation comprisesinitiating or terminating stimulation based on which at least one sleepstate or stage is detected.
 10. The method of claim 4, wherein treatingthe physiological condition comprises delivering a drug.
 11. The methodof claim 10, wherein delivering the drug delivery initiating orterminating drug delivery based on which at least one sleep state orstage is detected.
 12. The method of claim 1, further comprisingprocessing the physiological information based on histogram counts. 13.The method of claim 1, further comprising processing the physiologicalinformation based on threshold detections.
 14. The method of claim 1,wherein the specified bins correspond to delta, theta, alpha and betafrequency ranges.
 15. The method of claim 14 further comprisingdetermining a sleep stage from an absolute number of occurrences of thehalf waves in the specified bins corresponding to delta, theta, alphaand beta frequency ranges.
 16. The method of claim 14 further comprisingdetermining a sleep stage from a relative number of occurrences of thehalf waves in the specified bins corresponding to delta, theta, alphaand beta frequency ranges.
 17. The method of claim 14 further comprisingdetermining a sleep stage from a power of the half waves in thespecified bins corresponding to delta, theta, alpha and beta frequencyranges.